breaking chain logo
Free
Computer
Shop

Compiling Guile from source

I recently installed Guile by compiling from the source tarball. The INSTALL file that came in the tarball was not explicit enough for me to do it. Fortunately, I got some help from the guile-user mailing list, and was able to do it.

The install was done on a fairly new Debian system. Many of the things I had to install are probably already on any machine that has been in use for a while.

The following are some notes I kept. I hope they may help someone. Maybe some of this can be copied to INSTALL file.

First I put the tar files in a build directory. The gmp file is needed to do high precision arithmetic for guile.

    hacker@fcs26:~$ ls .build/
    gmp-6.3.0.tar.xz  guile-3.0.9  guile-3.0.9.tar
    cd .build
    tar xvf gmp-6.3.0.tar.xz   ## uncompress and untar
When I tried to configure gmp I got an error that was simple to fix.
    hacker@fcs26:~/.build/gmp-6.3.0$ ./configure

    checking for suitable m4... configure: error:
      No usable m4 in $PATH or /usr/5bin (see config.log for reasons).

    apt-get install m4

    hacker@fcs26:~/.build/gmp-6.3.0$ make
    bash: make: command not found
    apt-get install make
    make; make check; su -; make install
As I said, it was a pretty empty system. You probably already have installed make, but I wrote it all down. Compiling gmp was easy. The trouble began whan I tried to configure Guile itself.
    hacker@fcs26:~/.build/guile-3.0.9$ ./configure
    configure: error: GNU libunistring is required, please install it.

    root@fcs26:~# apt-get install libunistring
    E: Unable to locate package libunistring

    root@fcs26:~# apt-get install libunistring2
    libunistring2 is already the newest version (1.0-2).
I asked the mailing list and was told that the "development" versions of Debian packages are needed. These contain not only the shared libraries, but also the header files and other things needed to compile with, as opposed to simply use, the package.
   apt-get install libunistring-dev

   ./configure
   configure: error: in `/home/hacker/.build/guile-3.0.9':
   configure: error: The pkg-config script could not be found or is too old.
   To get pkg-config, see http://pkg-config.freedesktop.org/.
I didn't need pkg-config source, so I just installed the Debian package.

I went on getting errors from configure and installing the development version of the package it complained about. The only tricky one was when in complained about bdw-gc it meant I needed to install libgc-dev. When I was done I had installed the following:

Total installs:
   apt-get install m4
   apt-get install make
   apt-get install libunistring-dev
   apt-get install pkgconf
   apt-get install libffi-dev
   apt-get install libgc-dev
   apt-get install libreadline-dev
make --- takes about 40 min on Intel core i7 Lenovo ThinkPad

Finally I was ready to test it:

    hacker@fcs26:~/.build/guile-3.0.9/meta$ ./guile
    GNU Guile 3.0.9
     ...
    scheme@(guile-user)> (cons 5 (list (+ 2 2) 'flubdubs 'foo))
    $1 = (5 4 flubdubs foo)
    scheme@(guile-user)> (exit)
…and install it:
    su - ; cd ~/.build/guile-3.0.9
    make install
    hacker@fcs26:~$ /usr/local/bin/guile
    GNU Guile 3.0.8
    scheme@(guile-user)> (* 2 (acos 0))
    $3 = 3.141592653589793
Close Enough!
Creative Commons License
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0